package yangcheng.third;

import java.util.Random;

public class Poker {
    String[] color={"草花","方片","红桃","黑桃"};
    String[] number={"K","Q","J","10","9","8","7","6","5","4","3","2","A"};
    int[] A=new int[15];
    int[] B=new int[4];
    String[] S= {"大王","小王"};
    Random Nc=new Random();
    Random N=new Random();

    public int getN(){
        return N.nextInt(15);
    }
    public int getNc(){
        return Nc.nextInt(4);
    }

    public void run(){
        int Nc = getNc();
        int N=getN();
        for(int x=0;x<17;x++){
            Nc = getNc();
            N=getN();
            if(N==13&&A[N]==0){
                System.out.print(S[0]+"  ");
                A[N]=1;
                continue;
            }
            if(N==14&&A[N]==0){
                System.out.print(S[1]+"  ");
                A[N]=1;
                continue;
            }

            if(A[N]==4||B[Nc]==13)continue;
            A[N]++;
            B[Nc]++;
            System.out.print(color[Nc]+number[N]+"  ");
        }
    }

}
